博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
网站用户头像管理
阅读量:4129 次
发布时间:2019-05-25

本文共 5079 字,大约阅读时间需要 16 分钟。

对于SNS网站来说,都少不了有用户头像上传、配置的功能,面临大量用户的情况,如何维护头像图片服务器?这里,我推荐一个我刚刚发现的头像管理的网站,提供功能强大的插件功能。

 

 

返回的数据可以有多种格式:XML、Json、PHP、VCcard等

 

简单看下返回的JSON格式数据:

1. 创建一个可用的

2. 创建一个  url地址

3. 将上面的url地址 命名为 .json

 

最后,生成的请求用户图片的url路径地址如下面形式:

 

示例:

<script type="text/javascript">

function changeTitle( profile ) {
 document.title = profile.entry[0].displayName;
}
</script>
<script src="" type="text/javascript"></script>

 

返回的数据如下:

changeTitle({"entry":[{"id":"1428","hash":"205e460b479e2e5b48aec07710c08d50","requestHash":"205e460b479e2e5b48aec07710c08d50","profileUrl":"http:gravatar.com//beau","preferredUsername":"beau","thumbnailUrl":"http:0.gravatar.com//avatar//205e460b479e2e5b48aec07710c08d50","photos":[{"value":"http:0.gravatar.com//avatar//205e460b479e2e5b48aec07710c08d50","type":"thumbnail"},{"value":"http:0.gravatar.com//userimage//1428//75ad2fafd20dd9302f42b0a02d51e860"},{"value":"http:0.gravatar.com//userimage//1428//9564d785bb3d64c03d26b2de426c4312"},{"value":"http:1.gravatar.com//userimage//1428//a5d0e4d405a047e5b567e488dbc1eb21"},{"value":"http:1.gravatar.com//userimage//1428//feb73c66a51313817aad85ebaba82ba3"}],"profileBackground":{"color":"#267817","position":"left","repeat":"repeat","url":"http:1.gravatar.com//bg//1428//61e2c0ec1394308ed63118fa7c30230a"},"name":{"givenName":"Beau","familyName":"Lebens","formatted":"Beau Lebens"},"displayName":"Beau Lebens","aboutMe":"I'm a Code Wrangler at Automattic
and work on
Gravatar
,
IntenseDebate
,
WordPress.com
and once in a while
WordPress.org
. I love my job. I've been coding in PHP for around 10 years and working with HTML for almost 14./n/nWhen I'm not working, I'm an avid practitioner of
Krav Maga
and love camping//hiking when I get the chance. I live in San Francisco, which is, IMHO, one of the best cities in the world. I grew up in Australia, but haven't lived there for 6 years now.","currentLocation":"San Francisco, CA, USA","phoneNumbers":[{"type":"mobile","value":"14152790783"}],"emails":[{"primary":"true","value":"beau@dentedreality.com.au"}],"ims":[{"type":"aim","value":"beaulebens"},{"type":"msn","value":"beau@dentedreality.com.au"},{"type":"yahoo","value":"beaulebens"},{"type":"icq","value":"798818"},{"type":"gtalk","value":"beau.lebens@gmail.com"},{"type":"skype","value":"borkazoid"}],"accounts":[{"domain":"blogger.com","display":"blogger.com","url":"http:www.blogger.com//profile//16955909532360216492","userid":"16955909532360216492","verified":"true","shortname":"blogger"},{"domain":"facebook.com","display":"beaulebens","url":"http:www.facebook.com//beaulebens","username":"beaulebens","verified":"true","shortname":"facebook"},{"domain":"flickr.com","display":"borkazoid","url":"http:www.flickr.com//people//borkazoid//","username":"borkazoid","verified":"true","shortname":"flickr"},{"domain":"friendfeed.com","display":"beaulebens","url":"http:friendfeed.com//beaulebens","username":"beaulebens","verified":"true","shortname":"friendfeed"},{"domain":"foursquare.com","display":"foursquare.com","url":"http:foursquare.com//user//-3277","userid":"-3277","verified":"true","shortname":"foursquare"},{"domain":"linkedin.com","display":"beaulebens","url":"http:www.linkedin.com//in//beaulebens","username":"beaulebens","verified":"true","shortname":"linkedin"},{"domain":"myspace.com","display":"beaulebens","url":"http:www.myspace.com//beaulebens","username":"beaulebens","verified":"true","shortname":"myspace"},{"domain":"posterous.com","display":"beau","url":"http:beau.posterous.com","username":"beau","verified":"true","shortname":"posterous"},{"domain":"tripit.com","display":"beaulebens","url":"http:tripit.com//people//beaulebens","username":"beaulebens","verified":"true","shortname":"tripit"},{"domain":"tumblr.com","display":"beaulebens","url":"http:beaulebens.tumblr.com//","username":"beaulebens","verified":"true","shortname":"tumblr"},{"domain":"twitter.com","display":"@beaulebens","url":"http:twitter.com//beaulebens","username":"beaulebens","verified":"true","shortname":"twitter"},{"domain":"vimeo.com","display":"beau","url":"http:vimeo.com//beau","username":"beau","verified":"true","shortname":"vimeo"},{"domain":"dentedreality.com.au","display":"dentedreality.com.au","url":"http:dentedreality.com.au//","username":"dentedreality.com.au","verified":"true","shortname":"wordpress"},{"domain":"profiles.yahoo.com","display":"profiles.yahoo.com","url":"http:profiles.yahoo.com//u//V7GX4AZFSTGGD3RRBWIBWEP7Z4","userid":"V7GX4AZFSTGGD3RRBWIBWEP7Z4","verified":"true","shortname":"yahoo"},{"domain":"youtube.com","display":"beaulebens","url":"http:www.youtube.com//user//beaulebens","username":"beaulebens","verified":"true","shortname":"youtube"}],"urls":[{"value":"http:dentedreality.com.au","title":"Dented Reality"},{"value":"http:intensedebate.com","title":"IntenseDebate"},{"value":"http:wordpress.com","title":"WordPress.com"},{"value":"http:automattic.com","title":"Automattic"},{"value":"http:gravatar.com","title":"Gravatar"},{"value":"http:mybabyourbaby.com","title":"MyBabyOurBaby.com"}]}]});

 

另外,将网站与Google结合,用 登录的,您只需在 Google 上设置您的头像就可以了。

 

应用实例:

 

转载地址:http://tykvi.baihongyu.com/

你可能感兴趣的文章
Android中AsyncTask的简单用法
查看>>
带WiringPi库的交叉笔译如何处理二之软链接概念
查看>>
fastcgi_param 详解
查看>>
poj 1976 A Mini Locomotive (dp 二维01背包)
查看>>
db db2_monitorTool IBM Rational Performace Tester
查看>>
postgresql监控工具pgstatspack的安装及使用
查看>>
【JAVA数据结构】双向链表
查看>>
【JAVA数据结构】先进先出队列
查看>>
Objective-C 基础入门(一)
查看>>
Flutter Boost的router管理
查看>>
iOS开发支付集成之微信支付
查看>>
C++模板
查看>>
【C#】如何实现一个迭代器
查看>>
【C#】利用Conditional属性完成编译忽略
查看>>
VUe+webpack构建单页router应用(一)
查看>>
(python版)《剑指Offer》JZ01:二维数组中的查找
查看>>
Spring MVC中使用Thymeleaf模板引擎
查看>>
PHP 7 的五大新特性
查看>>
深入了解php底层机制
查看>>
PHP中的stdClass 【转】
查看>>